let isInited = false;
const maps = new Map<number, string>();

function initWidgets(){
	maps.clear();
	const modules = import.meta.globEager("./*.vue");
	Object.keys(modules).forEach((it: any) => {
		maps.set(modules[it].default.type,modules[it].default.name);
	});
	isInited = true;

	console.debug("初始化组件数据",maps);
}

export default function showWidget(type: number) {
	if(!isInited){
		initWidgets();
	}

	const v = maps.get(type);
	if(v){
		return v;
	}else{
		console.error("出现未处理的type。值：", type);
		return null;
	}
}